<include file="Public/head" />
<style type="text/css">
    .cheyuan2{display: block;margin-top: 15px;}
    .cheyuan2{color: #303030;float: left;margin-left: 20px;margin-bottom:15px;}
    .cheyuan2 .order_status {background: #fff url("{:get_style_cdnurl()}paimai/yunying/images/sanjiao.jpg") no-repeat scroll 130px 6px;  height: 26px;  line-height: 26px;  margin-right: 10px;  text-indent: 2px;  width: 150px;  }
    .create_marks{ background: #20ab4f none repeat scroll 0 0; border: medium none;border-radius: 3px;color: #fff;margin-left: 7px;padding: 0;width: 120px;}
    .cheyuan-btn{ background: #20ab4f none repeat scroll 0 0; border: medium none;border-radius: 3px;color: #fff;margin-left: 7px;padding: 0;width: 80px;height:24px;}
    .cheyuan2 select{ border: 1px solid #d7d7d7;float: left;height: 22px;line-height: 22px;text-align: center;width: 150px;margin-left: 36px; }
    .table .mcenter{vertical-align: middle;text-align: center;}
</style>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar"  menu="cxtj.csgl" />
    <div class="mianR">
        <h3 class="cha">车商维保保养记录管理</h3>

        <div class="cheyuan2">
            <div style="float:left;width:280px">
                <input type="text" name="start_time" placeholder="开始时间" value="{$st}" class="xiaci xin-text1 time-end" id="start_time" readonly>
                - <input type="text" name="end_time"  placeholder="结束时间" value="{$et}" class="xiaci xin-text1 time-end" id="end_time" readonly />
            </div>
            <select name="order_status" id="order_status" class="order_status" style=" margin-left:10px">
                <option value="">请选择订单状态</option>
                <?php foreach(C('DEALER_REPAIR_CHECK_SEARCH_STATUS') as $key=>$val):?>
                <option value="{$key}">{$val}</option>
                <?php endforeach ?>
            </select>
            <input type="button" value="搜索" name="cyxs_search" class="cheyuan-btn"  />
        </div>
        <div class="yuList">
            <div class="listBox" id="listBox"></div>
        </div>

        <div class="clear"></div>
     </div>
    <script type="text/javascript">
        function get_list() {
            var url = mkurl();
            var purl = '';
            $.get("/CarDealer/get_dealer_repair_list/dealer_id/{$dealer_id}", encodeURI(url), function (data) {
                $("#listBox").html(data);
            }, "html");
        }

        function get_page(p) {
            var url = mkurl();
            url += "&p=" + p;
            $.get("/CarDealer/get_dealer_repair_list/dealer_id/{$dealer_id}", encodeURI(url), function (data) {
                $("#listBox").html(data);
            }, "html");
        }
        $("input[name='cyxs_search']").on("click", function () {
            get_list();
        });
        //搜索
        function mkurl() {
            var url = "";
            var start_time = $('#start_time').val();
            var end_time = $('#end_time').val();
            var order_status =$('#order_status').val();
            if (start_time) {
                url += '&start_time=' + start_time;
            }
            if (end_time) {
                url += '&end_time=' + end_time;
            }
            if (order_status) {
                url += '&order_status=' + order_status;
            }
            return url;
        }
        get_list();

        function GetDateStr(AddDayCount) {
            var dd = new Date();
            dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
            var y = dd.getFullYear();
            var m = dd.getMonth()+1;//获取当前月份的日期
            var d = dd.getDate();
            return y+"-"+m+"-"+d;
        }
//        var Yesterday = GetDateStr(-1);

        $("#start_time").ymdateplugin({
            changeMonth: true,
            changeYear: true,
//            maxDate:Yesterday
        });

        $("#end_time").ymdateplugin({
            changeMonth: true,
            changeYear: true,
//            maxDate:Yesterday
        });
    </script>
    <include file="Public/foot" />
